package com.jiyun.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.cn.jiyun.entity.pojo.Strategy;
import com.jiyun.mapper.YouMapper;
import com.jiyun.service.YouService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class YouServiceImpl extends ServiceImpl<YouMapper, Strategy> implements YouService {
    @Autowired
    private YouMapper youMapper;
    @Override
    public List<Strategy> findAll() {
        return youMapper.findAll();
    }

    @Override
    public Strategy findid(Integer strategyId) {
        LambdaQueryWrapper<Strategy> queryWrapper = new LambdaQueryWrapper<>();
        LambdaQueryWrapper<Strategy> eq = queryWrapper.eq(Strategy::getStrategyId, strategyId);
        Strategy strategy = youMapper.selectOne(eq);
        return strategy;
    }
}
